#pragma once

class Vec2i
{
public:
	Vec2i();
	Vec2i(const Vec2i &rhs);
	Vec2i(Vec2i &&rvalue);
	Vec2i(int x, int y);
	~Vec2i();

	int x() const { return x_; }
	int &x() { return x_; }

	int y() const { return y_; }
	int &y() { return y_; }

	int distance(const Vec2i &rhs) const;
	int distance(int x, int y) const;

	bool operator==(const Vec2i &rhs) const { return (x_ == rhs.x() && y_ == rhs.y()); }

	Vec2i operator+(const Vec2i &rhs) const { return Vec2i(x_+rhs.x(), y_+rhs.y()); }
	Vec2i operator+(int rhs) const { return Vec2i(x_+rhs, y_+rhs); }

	Vec2i operator-(const Vec2i &rhs) const { return Vec2i(x_-rhs.x(), y_-rhs.y()); }
	Vec2i operator-(int rhs) const { return Vec2i(x_-rhs, y_-rhs); }

	Vec2i operator/(const Vec2i &rhs) const { return Vec2i(x_/rhs.x(), y_/rhs.y()); }
	Vec2i operator/(int rhs) const { return Vec2i(x_/rhs, y_/rhs); }

	Vec2i operator/=(const Vec2i &rhs) { x_ /= rhs.x(); y_ /= rhs.y(); return *this; }
	Vec2i operator/=(int rhs) { x_ /= rhs, y_ /= rhs; return *this; }
	
private:
	int x_,y_;
};
